3.1.1 \(\int \frac {\cos ^4(x)}{i+\cot (x)} \, dx\) [1]

Optimal. Leaf size=78 \[ -\frac {i x}{16}+\frac {1}{32 (i-\cot (x))^2}+\frac {i}{8 (i-\cot (x))}-\frac {i}{24 (i+\cot (x))^3}+\frac {5}{32 (i+\cot (x))^2}+\frac {3 i}{16 (i+\cot (x))} \]

[Out]

-1/16*I*x+1/32/(I-cot(x))^2+1/8*I/(I-cot(x))-1/24*I/(I+cot(x))^3+5/32/(I+cot(x))^2+3/16*I/(I+cot(x))

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 78, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {3597, 862, 90, 209} \begin {gather*} -\frac {i x}{16}+\frac {i}{8 (-\cot (x)+i)}+\frac {3 i}{16 (\cot (x)+i)}+\frac {1}{32 (-\cot (x)+i)^2}+\frac {5}{32 (\cot (x)+i)^2}-\frac {i}{24 (\cot (x)+i)^3} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[x]^4/(I + Cot[x]),x]

[Out]

(-1/16*I)*x + 1/(32*(I - Cot[x])^2) + (I/8)/(I - Cot[x]) - (I/24)/(I + Cot[x])^3 + 5/(32*(I + Cot[x])^2) + ((3
*I)/16)/(I + Cot[x])

Rule 90

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandI
ntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] &&
(IntegerQ[p] || (GtQ[m, 0] && GeQ[n, -1]))

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 862

Int[((d_) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[(d + e*x)
^(m + p)*(f + g*x)^n*(a/d + (c/e)*x)^p, x] /; FreeQ[{a, c, d, e, f, g, m, n}, x] && NeQ[e*f - d*g, 0] && EqQ[c
*d^2 + a*e^2, 0] && (IntegerQ[p] || (GtQ[a, 0] && GtQ[d, 0] && EqQ[m + p, 0]))

Rule 3597

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[b/f, Subst[Int
[x^m*((a + x)^n/(b^2 + x^2)^(m/2 + 1)), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[m/
2]

Rubi steps

\begin {align*} \int \frac {\cos ^4(x)}{i+\cot (x)} \, dx &=-\text {Subst}\left (\int \frac {x^4}{(i+x) \left (1+x^2\right )^3} \, dx,x,\cot (x)\right )\\ &=-\text {Subst}\left (\int \frac {x^4}{(-i+x)^3 (i+x)^4} \, dx,x,\cot (x)\right )\\ &=-\text {Subst}\left (\int \left (\frac {1}{16 (-i+x)^3}-\frac {i}{8 (-i+x)^2}-\frac {i}{8 (i+x)^4}+\frac {5}{16 (i+x)^3}+\frac {3 i}{16 (i+x)^2}-\frac {i}{16 \left (1+x^2\right )}\right ) \, dx,x,\cot (x)\right )\\ &=\frac {1}{32 (i-\cot (x))^2}+\frac {i}{8 (i-\cot (x))}-\frac {i}{24 (i+\cot (x))^3}+\frac {5}{32 (i+\cot (x))^2}+\frac {3 i}{16 (i+\cot (x))}+\frac {1}{16} i \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\cot (x)\right )\\ &=-\frac {i x}{16}+\frac {1}{32 (i-\cot (x))^2}+\frac {i}{8 (i-\cot (x))}-\frac {i}{24 (i+\cot (x))^3}+\frac {5}{32 (i+\cot (x))^2}+\frac {3 i}{16 (i+\cot (x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.13, size = 60, normalized size = 0.77 \begin {gather*} -\frac {1}{192} i \left (12 x-18 i \cos ^2(x)-6 i \cos (2 x)-6 i \cos (4 x)-i \cos (6 x)+3 \sin (2 x)-3 \sin (4 x)-\sin (6 x)\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[x]^4/(I + Cot[x]),x]

[Out]

(-1/192*I)*(12*x - (18*I)*Cos[x]^2 - (6*I)*Cos[2*x] - (6*I)*Cos[4*x] - I*Cos[6*x] + 3*Sin[2*x] - 3*Sin[4*x] -
Sin[6*x])

________________________________________________________________________________________

Maple [A]
time = 0.26, size = 56, normalized size = 0.72

method result size
risch \(-\frac {i x}{16}-\frac {{\mathrm e}^{-6 i x}}{192}-\frac {\cos \left (4 x \right )}{32}+\frac {i \sin \left (4 x \right )}{64}-\frac {5 \cos \left (2 x \right )}{64}-\frac {i \sin \left (2 x \right )}{64}\) \(39\)
default \(-\frac {i}{16 \left (\tan \left (x \right )+i\right )}+\frac {1}{32 \left (\tan \left (x \right )+i\right )^{2}}+\frac {\ln \left (\tan \left (x \right )+i\right )}{32}-\frac {i}{24 \left (\tan \left (x \right )-i\right )^{3}}+\frac {1}{32 \left (\tan \left (x \right )-i\right )^{2}}-\frac {\ln \left (\tan \left (x \right )-i\right )}{32}\) \(56\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)^4/(I+cot(x)),x,method=_RETURNVERBOSE)

[Out]

-1/16*I/(tan(x)+I)+1/32/(tan(x)+I)^2+1/32*ln(tan(x)+I)-1/24*I/(tan(x)-I)^3+1/32/(tan(x)-I)^2-1/32*ln(tan(x)-I)

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)^4/(I+cot(x)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: Error executing code in Maxima: expt: undefined: 0 to a negative e
xponent.

________________________________________________________________________________________

Fricas [A]
time = 3.12, size = 39, normalized size = 0.50 \begin {gather*} \frac {1}{384} \, {\left (-24 i \, x e^{\left (6 i \, x\right )} - 3 \, e^{\left (10 i \, x\right )} - 18 \, e^{\left (8 i \, x\right )} - 12 \, e^{\left (4 i \, x\right )} - 9 \, e^{\left (2 i \, x\right )} - 2\right )} e^{\left (-6 i \, x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)^4/(I+cot(x)),x, algorithm="fricas")

[Out]

1/384*(-24*I*x*e^(6*I*x) - 3*e^(10*I*x) - 18*e^(8*I*x) - 12*e^(4*I*x) - 9*e^(2*I*x) - 2)*e^(-6*I*x)

________________________________________________________________________________________

Sympy [A]
time = 0.08, size = 54, normalized size = 0.69 \begin {gather*} - \frac {i x}{16} - \frac {e^{4 i x}}{128} - \frac {3 e^{2 i x}}{64} - \frac {e^{- 2 i x}}{32} - \frac {3 e^{- 4 i x}}{128} - \frac {e^{- 6 i x}}{192} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)**4/(I+cot(x)),x)

[Out]

-I*x/16 - exp(4*I*x)/128 - 3*exp(2*I*x)/64 - exp(-2*I*x)/32 - 3*exp(-4*I*x)/128 - exp(-6*I*x)/192

________________________________________________________________________________________

Giac [A]
time = 0.43, size = 63, normalized size = 0.81 \begin {gather*} \frac {3 \, \tan \left (x\right )^{2} + 10 i \, \tan \left (x\right ) - 9}{64 \, {\left (-i \, \tan \left (x\right ) + 1\right )}^{2}} + \frac {11 \, \tan \left (x\right )^{3} - 33 i \, \tan \left (x\right )^{2} - 27 \, \tan \left (x\right ) - 3 i}{192 \, {\left (\tan \left (x\right ) - i\right )}^{3}} + \frac {1}{32} \, \log \left (\tan \left (x\right ) + i\right ) - \frac {1}{32} \, \log \left (\tan \left (x\right ) - i\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)^4/(I+cot(x)),x, algorithm="giac")

[Out]

1/64*(3*tan(x)^2 + 10*I*tan(x) - 9)/(-I*tan(x) + 1)^2 + 1/192*(11*tan(x)^3 - 33*I*tan(x)^2 - 27*tan(x) - 3*I)/
(tan(x) - I)^3 + 1/32*log(tan(x) + I) - 1/32*log(tan(x) - I)

________________________________________________________________________________________

Mupad [B]
time = 0.32, size = 48, normalized size = 0.62 \begin {gather*} -\frac {x\,1{}\mathrm {i}}{16}+\frac {-\frac {{\mathrm {tan}\left (x\right )}^4}{16}+\frac {{\mathrm {tan}\left (x\right )}^3\,1{}\mathrm {i}}{16}-\frac {5\,{\mathrm {tan}\left (x\right )}^2}{48}+\frac {\mathrm {tan}\left (x\right )\,5{}\mathrm {i}}{48}+\frac {1}{6}}{{\left (\mathrm {tan}\left (x\right )+1{}\mathrm {i}\right )}^2\,{\left (1+\mathrm {tan}\left (x\right )\,1{}\mathrm {i}\right )}^3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)^4/(cot(x) + 1i),x)

[Out]

((tan(x)*5i)/48 - (5*tan(x)^2)/48 + (tan(x)^3*1i)/16 - tan(x)^4/16 + 1/6)/((tan(x) + 1i)^2*(tan(x)*1i + 1)^3)
- (x*1i)/16

________________________________________________________________________________________